Skip to content

[gradle-0.2] Kotlin DSL fixes and functional test framework#13

Open
LexManos wants to merge 4 commits intoMinecraftForge:mainfrom
LexManos:functional-tests
Open

[gradle-0.2] Kotlin DSL fixes and functional test framework#13
LexManos wants to merge 4 commits intoMinecraftForge:mainfrom
LexManos:functional-tests

Conversation

@LexManos
Copy link
Member

@LexManos LexManos commented Feb 1, 2026

I am not a fan of Kotlin, and Gradle's docs are as good as you would expect.
But I figured out something functional.
Added a simple kotlin and groovy functional test.
We need to figure out what features are expected write up tests for them.

Note, I had to do some stupid hacks to get pluginUnderTestMetadata to function under eclipse (got to love gradle's consistency) but should be fine under IDEA.

I also disabled the broken TestPathFS tests. I have no clue what the original intention of these tests were but I did a checkout of the original commit and they are broken as well. So I don't expect they ever functioned.

I added a default override for jarJar.configure(this) that takes no Action so that kotlin compiles fine. Before you needed jarJar.configure(this){}

If you wanna run it from the command line its :jarjar-gradle:functionalTest

@LexManos LexManos requested a review from Jonathing February 1, 2026 21:46
@Jonathing Jonathing changed the title Kotlin Fix and functional test framework [gradle-0.2] Kotlin DSL fixes and functional test framework Feb 1, 2026
@Jonathing Jonathing self-assigned this Feb 1, 2026
@Jonathing
Copy link
Member

I mentioned the other day that we need to make a Gradle plugin to streamline plugin development. This Eclipse-specific stuff to make the plugin tests happy are a perfect example of this.

Copy link
Member

@Jonathing Jonathing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for your work.

@LexManos
Copy link
Member Author

LexManos commented Feb 1, 2026

I mentioned the other day that we need to make a Gradle plugin to streamline plugin development. This Eclipse-specific stuff to make the plugin tests happy are a perfect example of this.

Ya, its a set of 'magic' that may be needed for gradle utils or something.

This functional test stuff would also be useful as a external library. There are a bunch of helpers gradle uses their their functional tests, but one of them are exposed as a consumable library. I cant find any other 3rd party library for these helpers. Plus we have multiple plugins that could benefit from a fucntional test setup. So seems like we'll have to roll our own.

@LexManos
Copy link
Member Author

LexManos commented Feb 2, 2026

Alright, refactored the code to be a little cleaner/isolate functions.
And added a test/example for constraint only dependency.

I don't think there are any other examples we need but if anyone wants more, I can write them up just ask here or in MDKExamples.

Note: the functional tests do not show any failure/problem reporting tests, because I don't think they are needed. But they can easily be added.

The GroovyProject and KotlinProject show the example code. Where GradleProject is all the helper. This isolates the actual buildscript code nicely allowing very easy comparisons between groovy and kotlin.

Give this a sanity check when you can @Jonathing and if it works for you pull it.
For now I am not worried about making the helper plugin with the eclipse/test magic. We can copy/paste it into the other plugins for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants